var express = require('express');

var pointlist = require('./data/test.json');

var data = pointlist.map(p => {
  // p.team = Math.random()*10000 + 60 >> 0;
  p.data.map(t => {
    t.time = 8*Math.random()
    return t
  })
  return p
})

var app = express();

app.use(express.static(__dirname + '/static'));

app.get('/', function(req, res) {
  res.sendFile(__dirname + '/views/b_index.html');
})


var limit = 0;

app.post('/task', function(req, res) {
  if (limit === 24) {
    limit = 0;
  }

  res.send(JSON.stringify(data[limit]))
  limit++;
  return
})

app.listen(8088);
